<?php
include("inc_resize2.php");
// 链接数据库
	$dbhost = "222.73.231.208";
	$dbuser = "a0913144255";
	$dbpwd = "17845852";
	$dbname = "a0913144255";
	// 连数据库
	$db = mysql_connect($dbhost,$dbuser,$dbpwd);
	// 设置数据库编码
	mysql_query("set names 'utf8'");
	// 选择具体的数据库
	mysql_select_db($dbname,$db);
	
// SQL 语句
// 每次操作120条就差不多了，200条就不行了。
	$sql = "select pic from jiaju_product where proid >332 and proid<350";
// 执行SQL语句
	$result =mysql_query($sql);	
	
	
	
	
	
?>
<?php 


	// ------------------------------------------------------------------------
	/**
		* 将图片字符串变成数组
	*/
	function getarrp($pic)
	{
		$arrurl =  preg_split("/@/",$pic);
		return $arrurl;
	}

	
	// ------------------------------------------------------------------------
	/*
		* 格式： a.jpg@b.jpg@c.jpg@
	
	*/

if(!($myrow = mysql_fetch_row($result)))	
{
	echo "没有内容";
}
else
{
	$j = 1;
	do
	{
		
		$imgurls = $myrow[0];
		
		
		$arrpic = getarrp($imgurls);
		$att = "_icon";
		$filepath = "../../jiaju369img/user/"; // 上传后的路径
		for($i = 0;$i+1 < count($arrpic);$i++):
			// 对第一张图，做缩略图
			if($i == 0)
			{
				new resizeimage($filepath.$arrpic[$i],"231","220",$att);
			}
			// 然后对所有图做水印
			setWater($filepath.$arrpic[$i],"logo.png","WWW.JiaJu369.Com","254,238,039","7","arial.ttf","img");
		endfor;

		echo "成功$j<br />";
		$j ++ ;

	}while($myrow = mysql_fetch_row($result));
}

































// 执行SQL语句

echo "<table>";
if(!($myrow = mysql_fetch_row($result)))	
{
	echo "没有内容";
}
else
{
	do
	{
?> 
  
  <tr>
    <td><?php echo $myrow[0];?></td>

  </tr>
<?php 
	}while($myrow = mysql_fetch_row($result));
}
echo "</table>";
?>  